<?php
	$tmp = Zend_Controller_Front::getInstance()->getRequest()->getPathInfo();
 	$curUrl = $this->baseUrl() . Zend_Controller_Front::getInstance()->getRequest()->getPathInfo();
 	if($tmp == '/'){
 		$curUrl = $curUrl . 'news/index/index';
 	}
	if (strlen(strstr($curUrl, '/page/')) > 0) {
       $temp = explode('/page/', $curUrl);
       $curUrl = $temp[0];
    }
	$linkPrevious = '#';
	if(isset($this->previous)){
		$linkPrevious 	= $curUrl . '/page/' . $this->previous;
	}
	$linkNext = '#';
	if(isset($this->next)){
		$linkNext 		= $curUrl . '/page/' . $this->next;
	}	
	$strPage  = '';
	foreach ($this->pagesInRange as $key)
	{
		if($this->current == $key){
			$strPage .= '<a class="active" href="#">' . $key .'</a>';
		}else{
			$linkPage = $curUrl . '/page/' . $key;
			$strPage .= '<a id="cur_page" href="' . $linkPage . '">' . $key .'</a>';
		}
	}
?>
<ul>
	<li><a href="<?php echo $linkPrevious;?>"><span class="prev">Prev</span></a></li>
   	<li><?php echo $strPage;?></li>
   	<li><a href="<?php echo $linkNext;?>"><span class="next">Next</span></a></li>
</ul>
